package CoursePracticCode;



public class PlaneMthode {
    private double price;
    private int month;
    private int type;
    private int select;

    //设置get，set方法
    public double getPrice() {
        return price;
    }

    public int getMonth() {
        return month;
    }

    public int getType() {
        return type;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSelect() {
        return select;
    }

    public void setSelect(int select) {
        this.select = select;
    }
   public PlaneMthode(){
        this.price=price;
        this.select=select;
        this.month=month;
        this.type=type;
   }
    public PlaneMthode(double price,int month,int type,int select){
        this.price=price;
        this.select=select;
        this.month=month;
        this.type=type;
    }
    //    判断机票类型是淡季还是旺季

    public int travel_In() {

        if (month <= 0 || month > 12) {




        }
      return month;
    }
//    根据月份判断机票的类型
    public int catelogy( int type){
       int a = 0;
       a = getMonth();

        if(a>=5 && a<=10){
           return type=0;
        }
        return type=1;
    }
//    根据机票的类型选择对应的机票
    public double select_price(int type,int select,double price) {


        int a;
        a = getSelect();
//        double price1;
//        price1 = getPrice()
//        double calculatePrice;
        if (type == 0) {
            switch (a) {
                case 0:
//                   setPrice( getPrice() * 0.9);
//                    setPrice(this.getPrice()*0.9);
                    this.price = this.price*0.9;
                    break;
                case 1:
                    this.price = this.price*0.85;
                    break;

            }
        } else if (type == 1) {
            switch (a) {
                case 0:
                    this.price = this.price*0.7;
                    break;
                case 1:
                    this.price = this.price*0.65;
                    break;

            }

        }
        return price ;



    }
}
